<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

namespace App\Http\Requests;

use App\Enums\HonorTypeEnum;
use App\Rules\CheckEnum;

class HonorDisgracesCreateRequest extends CommonRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'organization' => 'required',
            'content' => 'required',
            'decision_time' => 'required',
            'type' => ['required', new CheckEnum(new HonorTypeEnum())],
            'credit_code' => 'required',
            'document_number' => 'required',
        ];
    }
}
